# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.PeeringRoute do
  @moduledoc """
  Exchanged network peering route.

  ## Attributes

  *   `destRange` (*type:* `String.t`, *default:* `nil`) - Output only. Destination range of the peering route in CIDR notation.
  *   `direction` (*type:* `String.t`, *default:* `nil`) - Output only. Direction of the routes exchanged with the peer network, from the VMware Engine network perspective: * Routes of direction `INCOMING` are imported from the peer network. * Routes of direction `OUTGOING` are exported from the intranet VPC network of the VMware Engine network.
  *   `imported` (*type:* `boolean()`, *default:* `nil`) - Output only. True if the peering route has been imported from a peered VPC network; false otherwise. The import happens if the field `NetworkPeering.importCustomRoutes` is true for this network, `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and the import does not result in a route conflict.
  *   `nextHopRegion` (*type:* `String.t`, *default:* `nil`) - Output only. Region containing the next hop of the peering route. This field only applies to dynamic routes in the peer VPC network.
  *   `priority` (*type:* `String.t`, *default:* `nil`) - Output only. The priority of the peering route.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Output only. Type of the route in the peer VPC network.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :destRange => String.t() | nil,
          :direction => String.t() | nil,
          :imported => boolean() | nil,
          :nextHopRegion => String.t() | nil,
          :priority => String.t() | nil,
          :type => String.t() | nil
        }

  field(:destRange)
  field(:direction)
  field(:imported)
  field(:nextHopRegion)
  field(:priority)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.PeeringRoute do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.PeeringRoute.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.PeeringRoute do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
